﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <!-- 2nd svn folder -->
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <link rel="Stylesheet" href="@Url.Content("~/content/themes/base/jquery.ui.all.css")" />
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    @if (User.IsInRole("Admin") || ViewBag.EnableAdminScripts == true)
    {
        <script src="@Url.Content("~/Scripts/jquery.maskedinput-1.3.min.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/jquery-ui-timepicker-addon.js")" type="text/javascript"></script>
        <script type="text/javascript" src="@Url.Content("~/ckeditor/ckeditor.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/ckeditor/adapters/jquery.js")"></script>
        <script src="@Url.Content("~/Scripts/Admin.js")" type="text/javascript"></script>
    }
</head>
<body class="@if (ViewBag.BodyCss != null)
             {<text>@ViewBag.BodyCss</text>}">
    <div class="page">
        <header>
            <div id="title">
                <h1 id="logo">@Html.ActionLink("Global Advantage", "Index", "Home")</h1>
            </div>
            <div id="logindisplay">
                @Html.Partial("_LogOnPartial")
            </div>
            <nav>
                <ul id="menu">
                    @if (User.IsInRole("Admin"))
                    {
                        <li>@Html.ActionLink("For Admins", "Index", "Admin")</li>
                        <li class="admin">@Html.ActionLink("For Trainers", "Index", "Trainer")</li>
                    }
                    else if (User.IsInRole("Trainer"))
                    {
                        <li class="trainer">@Html.ActionLink("For Trainers", "Index", "Trainer")</li>
                    }
                    @if (User.Identity.IsAuthenticated)
                    {
                        <li>@Html.ActionLink("My Training", "Index", "My")</li>   
                    }
                    <li>@Html.ActionLink("Videos", "Videos", "Home")</li>
                    <li>@Html.ActionLink("Modules", "Modules", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                </ul>
            </nav>
        </header>
        <div id="main">
            @if (ViewBag.LeftContent != null)
            {
                <div id="left">
                    @{ Html.RenderPartial((string)ViewBag.LeftContent); }
                </div>
            }
            <div id="content">
                <h2>@(ViewBag.H2Title ?? ViewBag.Title)</h2>
                @RenderBody()
            </div>
        </div>
        <footer>
        </footer>
    </div>
    @{
        string googleProfile = System.Configuration.ConfigurationManager.AppSettings["GoogleAnalyticsProfile"];
        if (!String.IsNullOrWhiteSpace(googleProfile))
        {
            <text>
                <script type="text/javascript">
                    var _gaq = _gaq || [];
                    _gaq.push(['_setAccount', '@(googleProfile)']);
                    _gaq.push(['_trackPageview']);

                    (function ()
                    {
                        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
                    })();
                </script>
            </text>   
        }        
    }
</body>
</html>
